# (decoded with TMPL 13671) /* %filename% */ /* Created %date% %time% by AppMaker */ %If MPW% #include #include #include #include #include #include #include #include %end if% #include "%unitname%.h" #define nil 0L /*Standard vars:*/ Boolean quittingTime; EventRecord curEvent; WindowPtr curWindow; WinInfoPtr cur; Boolean inBackground; WinInfoRec noCur; %If MPW% #pragma segment %unitname% %end if% /*----------*/ void InitGlobals () { curWindow = nil; noCur.text = nil; noCur.vScroll = nil; noCur.hScroll = nil; noCur.fileNum = 0; noCur.volNum = 0; noCur.dirty = false; noCur.windowKind = noWindow; cur = &noCur; } /*InitGlobals*/ /*----------*/ void SetInfo (window) WindowPtr window; { WinInfoPtr infoPtr; if (window != curWindow) { curWindow = window; if (curWindow != nil) { infoPtr = (WinInfoPtr) GetWRefCon (curWindow); cur = infoPtr; } else { cur = &noCur; } /*if*/ } /*if*/ } /*SetInfo*/ /*----------*/ void SetNewInfo (window) WindowPtr window; { WinInfoPtr infoPtr; infoPtr = (WinInfoPtr) NewPtr (sizeof (WinInfoRec)); SetWRefCon (window, (long) infoPtr); SetInfo (window); } /*SetNewInfo*/ /*----------*/ void DiscardInfo (window) WindowPtr window; { WinInfoPtr infoPtr; if (window == curWindow) { SetInfo (nil); } infoPtr = (WinInfoPtr) GetWRefCon (window); DisposPtr ((Ptr) infoPtr); HideWindow (window); DisposeWindow (window); } /*DiscardInfo*/